/*
 * @Author: 谢小康 2170673706@qq.com
 * @Date: 2023-12-17 19:48:57
 * @LastEditors: 谢小康 2170673706@qq.com
 * @LastEditTime: 2024-01-26 12:35:03
 * @FilePath: \My-bolg\server\router\lable.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */

const express = require('express');
const router = express.Router();
const {
    getLable,
    editLable,
    deleteLable,
    isUniqut,
    addlables,
    searchlable,
    getlablecount,
    deleteAllLableList,
    oneTimegetlables,
    selectlable
}=require("../controller/lable.js")
const {isSuperAdmin} = require('../controller/user.js')
const { auth } = require('../util/user');
/* 分页获取标签 */
router.get('/getlables',auth,getLable)
/* 编辑标签 */
router.post('/editlables',auth,isSuperAdmin,isUniqut,editLable)
/* 删除标签 */
router.post('/deletelable',auth,isSuperAdmin,deleteLable)
/* 添加标签  lablename */
router.post('/addlable',auth,isSuperAdmin,isUniqut,addlables)
/* 搜索标签按照关键字 */
router.post("/searchlable",auth,searchlable)
/* 获取所有标签的数量 */
router.get('/getlablescount',auth,getlablecount)
/* 批量删除标签 */
router.post("/deleteList",auth,isSuperAdmin,deleteAllLableList)

/* ---------------------------前台 */
router.post('/selectlable',selectlable)
/* -----------------------------------------公共 */
/* 一次性获取全部标签 */
router.get('/getalllables',oneTimegetlables)
module.exports = router